package com.itheima.dao;

import com.itheima.pojo.Permission;
import com.itheima.pojo.Role;
import com.itheima.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.Set;

public interface UserDao {
    public User findByUsername(String username);
    public Set<Role> findRoleById(int id);
    public Set<Permission> findPermission(int id);

    @Update("update t_user set password = #{password} where username = #{username}")
    void updatePasswordByUsername(@Param("username")String username,@Param("password") String newPassword);

    @Select("select * from t_user where username = #{user}")
    User findByUser(String username);

    void updatePasswordByUsernameOrTelephone(@Param("checkName") String checkName,@Param("encode") String encode);
}
